Merged
Conversation
Since location of Library\bin in virtual environment is not on the default search path, importing of dpctl failes due to unmet dependencies for native extensions of dpctl submodules. This change introduces _init_helper.py which implements the following logic using built-in os Python module: 1. If os.add_dll_directory exists, and VIRTUAL_ENV environment variable is set, and os.path.join(os.environ["VIRTUAL_ENV"], "Library", "bin") exists, call os.add_dll_directory with that directory. With this change the gh-1745 is fixed, and "python -m dpctl -f" works out of the box. Only GPU devices are visible, and to enable CPU device two additional steps must be performed: 1. Edit %VIRUAL_ENV%\Library\bin\cl.cfg and set CL_CONFIG_TBB_DLL_PATH variable at the bottom of the configuration file to the expanded value of %VIRUAL_ENV%\Library\bin\tbb12.dll but use forward slashes, instead of native backward slashes. 2. Append %VIRUAL_ENV%\Library\bin to the PATH using `set "PATH=%PATH%:%VIRTUAL_ENV%\Library\bin"` After these changes `python -m dpctl -f` should see CPU device.
Co-authored-by: ndgrigorian <[email protected]>
Use check suggested in PEP-0405 and pointed out by @ndgrigorian to compare sys.base_exec_prefix and sys.exec_prefix which would be different under virtual environment. The check that pyvenv.cfg exists is retained.
ndgrigorian
approved these changes
Dec 7, 2024
|
Deleted rendered PR docs from intelpython.github.com/dpctl, latest should be updated shortly. 🤞 |
|
Array API standard conformance tests for dpctl=0.18.2=py310hdf72452_6 ran successfully. |
|
Array API standard conformance tests for dpctl=0.18.2=py310hdf72452_5 ran successfully. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backporting gh-1922 to maintenance/0.18.x, which fixes gh-1745